UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DMqcNWYk/yO+pHMZPi67itgoPq9zsEfYtEb9UzIEl3g='
WHERE
key_id = '00b1e7d4e86236e07f13e08b05a28b75f60c922781fb8abf451a778f7e931ed3'
AND (
token = 'DMqcNWYk/yO+pHMZPi67itgoPq9zsEfYtEb9UzIEl3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)