UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4u2v8JdSM0nGQJ2Im/10l0vQJa3ib7nKb1ZYZrHa9Z4='
WHERE
key_id = 'fc36b8af1b901b28377bfe3fc0c558c1a1209a0d50b221943a6b5f86f69631b2'
AND (
token = '4u2v8JdSM0nGQJ2Im/10l0vQJa3ib7nKb1ZYZrHa9Z4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)