UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tqw1/H0pt7gngMkxg8hZ8jPPJ1+9zPk8hA3dTWcHGTI='
WHERE
key_id = '85dbc53ea8b5442a5a5ffea9605025f128f25a142692bd097f900df4369284b2'
AND (
token = 'tqw1/H0pt7gngMkxg8hZ8jPPJ1+9zPk8hA3dTWcHGTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)