UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vzq1ITKtB5zW2qIwlRFN/UveP5rISNuyzZYe5VF5EPY='
WHERE
key_id = '9bf91f32efdeec91a4c80f1d42b628875e704f652d4910170e314f16de94bc76'
AND (
token = 'vzq1ITKtB5zW2qIwlRFN/UveP5rISNuyzZYe5VF5EPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)