UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jkTOhcZkLcagfGwMyMT7vFnWH+HWW/4Ds2OhsZDlUN0='
WHERE
key_id = '15f3a9a2efd1a403d4d37d7ea3a180390fe8a7841f09cd75d0c04002b30c2eff'
AND (
token = 'jkTOhcZkLcagfGwMyMT7vFnWH+HWW/4Ds2OhsZDlUN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)