UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3KfgUuN2ZhRo6J8xyoFQV3bJSxnQhzzK1C9Q+Bpe9eo=' 
WHERE 
  key_id = '959652a120fef7b35971f7c5dc9ebed5c62ac7be83fac28ef7a77a0795977a91' 
  AND (
    token = '3KfgUuN2ZhRo6J8xyoFQV3bJSxnQhzzK1C9Q+Bpe9eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047