UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eG0KvZtRy3O+MgmV5fNwyzTJDHM3Gu527RP4frfA+/4=' 
WHERE 
  key_id = '46c4268267281d5c3aa645150d18f517a85b99301ae949597c8ff6d3fe958bc7' 
  AND (
    token = 'eG0KvZtRy3O+MgmV5fNwyzTJDHM3Gu527RP4frfA+/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033