UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jMouWzmun8FZzNs7Eh8Z64aVrGslRAtkjhk0NOSIQK4=' 
WHERE 
  key_id = 'ad3ca88cb734a9f447e3b51a4d0785d96c3fc4cbfbb17c07921266ea3f1f846c' 
  AND (
    token = 'jMouWzmun8FZzNs7Eh8Z64aVrGslRAtkjhk0NOSIQK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037