UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JFmKSPnNLKOP4Hxf7S+RcMTCZ4uUnfVjTgmHU4UYXdU=' 
WHERE 
  key_id = '39fbe6ec58876ae2ddd892ad0e1465fb19db6ce9a00467479717da0bf788d500' 
  AND (
    token = 'JFmKSPnNLKOP4Hxf7S+RcMTCZ4uUnfVjTgmHU4UYXdU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032