UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kv38ks3h1nPNarKtOWxv4yiH31FAK/sORDn/k0L7whk='
WHERE
key_id = '2d72267889e26faf41cc28aeecc22574e46401b3b7ecd89e828c0e5fe81a75b2'
AND (
token = 'Kv38ks3h1nPNarKtOWxv4yiH31FAK/sORDn/k0L7whk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)