UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RpOpbYQibllfjJCAqGd+NB1vJjqSCpShHR6KLC4v26M=' 
WHERE 
  key_id = '73e3d88c9210691b39f71929635b1090b86c7800e08030a4eed3a5222845fef0' 
  AND (
    token = 'RpOpbYQibllfjJCAqGd+NB1vJjqSCpShHR6KLC4v26M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019