UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PzQ8suNq8HOocoYSTNeV86fPD0yTrlC9x+Q4aq1fD2Y=' 
WHERE 
  key_id = '43ec71bfeb637c26f441c72fc307851b92cd53b797de8c81a1c4d948c2b27cc9' 
  AND (
    token = 'PzQ8suNq8HOocoYSTNeV86fPD0yTrlC9x+Q4aq1fD2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036