UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xxcSfUdKSWVresxwR23VDKN9mW07o3iKYdCGnIfAuxc='
WHERE
key_id = '0f08aec2f051b64879cec8070b8cd00f98dcb71bf86cf67ec1b31b25ffa81dc9'
AND (
token = 'xxcSfUdKSWVresxwR23VDKN9mW07o3iKYdCGnIfAuxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)