UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Moj7+CZQ43s9R4ss5/9vjSF756B2JPYggFQfSsZM/bk=' 
WHERE 
  key_id = '181c5cf2c28a8e9cc5cfcb585ef7c3dbc7810b651f023ecdb1ac85c409ebbc3e' 
  AND (
    token = 'Moj7+CZQ43s9R4ss5/9vjSF756B2JPYggFQfSsZM/bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033