UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tOLZRReRV+Snzh8zy9yCjoAY6USBukIBwH1WZlmOGpY='
WHERE
key_id = '6b9f5a70afd98fe367ad1f838d76f99af45ac15a0d450f422e4760a25fb046a3'
AND (
token = 'tOLZRReRV+Snzh8zy9yCjoAY6USBukIBwH1WZlmOGpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)