UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z1qhF7egB+uX9i5rizr9ZWhmPuIQx4JvkG85xzidf1k='
WHERE
key_id = 'ac2dcfd39867ae2c440ddb983b02e9253cdff8300d6fb593d39a8740ed472b54'
AND (
token = 'z1qhF7egB+uX9i5rizr9ZWhmPuIQx4JvkG85xzidf1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)