UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CnJUBBCgDcE2WpA/XjFBceRjwyPDYMnIFoviFyiz2Ks=' 
WHERE 
  key_id = 'e288e6a9b2655a5dc9ee551eb8a6b3d9fd81beef244428cb7e039ce26cb490f7' 
  AND (
    token = 'CnJUBBCgDcE2WpA/XjFBceRjwyPDYMnIFoviFyiz2Ks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028