UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '19Rybrsrga3P5hGshoNKfbOUwYkqmqVynofM1yFsbdc='
WHERE
key_id = '69eda75aa74ec1b48e17a0bb3bca7297472422ae50ac19c94fafd33939ad20d3'
AND (
token = '19Rybrsrga3P5hGshoNKfbOUwYkqmqVynofM1yFsbdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)