UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9XBVkkNFh/ubcs0V8wV/XxBs2MW47oanqODeXcMGaOs=' 
WHERE 
  key_id = '67046dc5d1fdede9731bd4e9de805fb237e145d5e16fc1cb6146bd68f9564d74' 
  AND (
    token = '9XBVkkNFh/ubcs0V8wV/XxBs2MW47oanqODeXcMGaOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027