UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eDMVl3Ay0kOt6q8txQJwkuHyMmkEfKrvSILS4zNeP2c=' 
WHERE 
  key_id = '80d732b3de79a4f6ab2957075f96250b0137a480990af21bd5a1f287514ad706' 
  AND (
    token = 'eDMVl3Ay0kOt6q8txQJwkuHyMmkEfKrvSILS4zNeP2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036