UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+OB7ncj/22oHMLEcwF7cB9kFAjQGJoHDbPwm56cZ/sc=' 
WHERE 
  key_id = 'e64bcb81f5b83bbf04a756e5b1db0ef3abdb1c1201b81631db3926712656579f' 
  AND (
    token = '+OB7ncj/22oHMLEcwF7cB9kFAjQGJoHDbPwm56cZ/sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027