UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'klpBV2oQ6SQxXRCFo1P80kURzfQjgkf5jZUp/az3DM8=' 
WHERE 
  key_id = '55e2e035169e114937488b0ad9e214e59799936f451a48df92f4c9e0e0c58fcb' 
  AND (
    token = 'klpBV2oQ6SQxXRCFo1P80kURzfQjgkf5jZUp/az3DM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00128