UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TRCYv+k/m6LWrae2RBjTrMu5O0NUmNwuxBYN5F/oORM=' 
WHERE 
  key_id = '924ff574d72699a6b9a217dfe28d522f0a2a1ff94935a598e6def5a7c5d49d87' 
  AND (
    token = 'TRCYv+k/m6LWrae2RBjTrMu5O0NUmNwuxBYN5F/oORM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037