UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BHHsNfiWVK8Vapz0Fc/vv3+YypPj47b+bv+VWxoZNGA='
WHERE
key_id = '06960447b0ae42780637a831ed86c2c31cc6002ad5e32feaa7f3ef916a767b43'
AND (
token = 'BHHsNfiWVK8Vapz0Fc/vv3+YypPj47b+bv+VWxoZNGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)