UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rtSbNFOWBd9e7diF4wuJ5VDW0WbPxtB1z69rjWNpfb8=' 
WHERE 
  key_id = 'f0ed4d8752a337c3cb7b72be3957a9f1bf05d9f1ddd7934504f8526ef79ca908' 
  AND (
    token = 'rtSbNFOWBd9e7diF4wuJ5VDW0WbPxtB1z69rjWNpfb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027