UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lNdiTeo/uHmOXP+hY7aogY1/7R9rqv5puGomK4yIIqc=' 
WHERE 
  key_id = 'a975f4b2eeca8e2b2549eece01b3cd1b20f7950b808892f439e474cf7a7e6801' 
  AND (
    token = 'lNdiTeo/uHmOXP+hY7aogY1/7R9rqv5puGomK4yIIqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034