UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9rkTCsmPKtZkX2wLi1LqiCWEUwaZSkcftrE4PY1m2yQ=' 
WHERE 
  key_id = '1657596aea2632aab4813cfa50fa8bb21e7145f3d8ea217fb4d0202429a23f32' 
  AND (
    token = '9rkTCsmPKtZkX2wLi1LqiCWEUwaZSkcftrE4PY1m2yQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043