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