UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hdmNdlejGYvaM6aRMDkBDBLKNMGhaGwUYDMbcB+mwFY='
WHERE
key_id = 'fa306245bd7ae544ab6f66752dbe44dfd30c5dc12b5ae12d04e3e85e40b7a7b2'
AND (
token = 'hdmNdlejGYvaM6aRMDkBDBLKNMGhaGwUYDMbcB+mwFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)