UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4gTCSSvh+CvX4xurk0SdJKcHS6urjX2uRpXd2iIobVE='
WHERE
key_id = '482bd3bf6516ee407851c7eabbec18e3092ea16d62557f6eface2c49eb4d8054'
AND (
token = '4gTCSSvh+CvX4xurk0SdJKcHS6urjX2uRpXd2iIobVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)