UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ui1S0S3PForrcwz9teDzKoPe1Wxz1n1ysiPLzth/9p0='
WHERE
key_id = '95afd852c54ce50a473c96efd8217ab7804a13841ec1921d133e29736c7d020a'
AND (
token = 'ui1S0S3PForrcwz9teDzKoPe1Wxz1n1ysiPLzth/9p0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)