UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vVLtVekzmGtmuvxC1I2G9Yq7l+AjmPuq5L8sKJz1o0E='
WHERE
key_id = '951690c3267cb6fb1301bea38f0abc7f66dec0bb742e497f7093beb658f227a3'
AND (
token = 'vVLtVekzmGtmuvxC1I2G9Yq7l+AjmPuq5L8sKJz1o0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)