UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vIN6/XViUrYe0ZlETsc0pNbq9XAI+IxXtRqrk2mYEvY=' 
WHERE 
  key_id = '8a2269d90b58d8868d0cab5b1084622265e1084b5ae72a44b88ed04f41ccba05' 
  AND (
    token = 'vIN6/XViUrYe0ZlETsc0pNbq9XAI+IxXtRqrk2mYEvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020