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

Query time 0.00030