UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fgxut4yL7GJ1D3mArmEeQP3gxxc84ISEh87KgF4K7yI=' 
WHERE 
  key_id = '383858a4b0a7583a3c08068e9946d4658717c9f8eaf132f0f0f6a91d19b79339' 
  AND (
    token = 'Fgxut4yL7GJ1D3mArmEeQP3gxxc84ISEh87KgF4K7yI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025