UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vDJqakBBgkspHYkgI5ynwaS0Kn17OH+FJKsyH8XhPJM='
WHERE
key_id = 'c27cf0721315568f3f300bd7ee99ea455df1b4446f62ba2781b53dd16f565ce5'
AND (
token = 'vDJqakBBgkspHYkgI5ynwaS0Kn17OH+FJKsyH8XhPJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)