UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DqAR2Sq/IFqs4ApAHBLB9jQzKeNx30yV5Il13ElJxU=' 
WHERE 
  key_id = 'fb8c6e5dc9f54c8366571f96e9490ca782e36bf4ea1f75ab0b4c1901051b0382' 
  AND (
    token = '3DqAR2Sq/IFqs4ApAHBLB9jQzKeNx30yV5Il13ElJxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038