UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2FBabiux+CEenknyuKDRgJ9kvIEgcWx4dUatq9E7tg='
WHERE
key_id = '9860a3aeeb4458614f2563eaff78e27a81133df2b17b70f1e57c7b6f098ec6ae'
AND (
token = 's2FBabiux+CEenknyuKDRgJ9kvIEgcWx4dUatq9E7tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)