UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DN73vq5Dl+lKZygjadLiv1+nDHEmw/8jPbe/ZBZNwP0='
WHERE
key_id = '723495316a4582e53d1382e9def2a50736cdbd43defe8a579c083d91fe1cfe57'
AND (
token = 'DN73vq5Dl+lKZygjadLiv1+nDHEmw/8jPbe/ZBZNwP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)