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

Query time 0.00025