UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eJ/nkX6knfh2NnLZf8nCGothrr1NcUUv/PzwCqN/vVQ=' 
WHERE 
  key_id = '884c5cfad528081ed1ba5b3f6fc697326c29bfb6c7e9eef137d33e32c1d4dc83' 
  AND (
    token = 'eJ/nkX6knfh2NnLZf8nCGothrr1NcUUv/PzwCqN/vVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040