UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9hjI7k63urZxuex4pzrNFOM039vef7RsWMwrhSCCBnA='
WHERE
key_id = '4cef6ea96f40d7642249fcefd7b60db53b6cd5e7cb6d2e2acf9aa0b51c7e537f'
AND (
token = '9hjI7k63urZxuex4pzrNFOM039vef7RsWMwrhSCCBnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)