UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hTzPfs7YKBqdLz1F2P20D19AQxy1Eadm8TscTg7pduE=' 
WHERE 
  key_id = '571aa85e8538c1fd3a8a2471f7cf80ba50b7b8ff68b22684616ef4bc8b0629fd' 
  AND (
    token = 'hTzPfs7YKBqdLz1F2P20D19AQxy1Eadm8TscTg7pduE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028