UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5FWEr1phKUsucRmNmKAp4GDDT7TSj7cD8zlKkZYhsys='
WHERE
key_id = '43328643ca20b4a51dc07da7a03360659bc273a62826484f168acd9d239de41a'
AND (
token = '5FWEr1phKUsucRmNmKAp4GDDT7TSj7cD8zlKkZYhsys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)