UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vHAbwnDPNeeglyBgLbDaMXooYyHfS7A9azf7neiAePc='
WHERE
key_id = '82b202132e2714212bd99cb0c4b0fab0be4eaba5262a73654898aa294da30937'
AND (
token = 'vHAbwnDPNeeglyBgLbDaMXooYyHfS7A9azf7neiAePc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)