UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K6uFyD/9fvZZQWWzY4xxg4kLR7TyU9V6hHPK8JlulvE='
WHERE
key_id = '67e0dbf573832a173bc7728d272bbe8373412703c7c4b9689d45aeacc31ee00a'
AND (
token = 'K6uFyD/9fvZZQWWzY4xxg4kLR7TyU9V6hHPK8JlulvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)