UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xko9JVsX0fZHpDvO9zK+aVl6C02HDW7Joo5tj3+bygY=' 
WHERE 
  key_id = 'f05dd137cb6fd75b87ac6ebff65911fc99f62c5ec78ec29082d353bda7b34eed' 
  AND (
    token = 'Xko9JVsX0fZHpDvO9zK+aVl6C02HDW7Joo5tj3+bygY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046