UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4x9VeaUineHS+VAzUi2/hC16TBcMYzQFqX/eJs8vRQo=' 
WHERE 
  key_id = '82067242925d72563d62041afe11258d5ed3f51453dbb97d010ee963a8e3815a' 
  AND (
    token = '4x9VeaUineHS+VAzUi2/hC16TBcMYzQFqX/eJs8vRQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022