UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NQJEIUQfHsO9KsHgbaS2ASBmu6nH5bM6HgZvDynT/eM='
WHERE
key_id = 'f9cf47d99e62a5f3d56f32c32b79d49a1105c0da99b87ecf75bab13dc60e3a38'
AND (
token = 'NQJEIUQfHsO9KsHgbaS2ASBmu6nH5bM6HgZvDynT/eM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)