UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mdJB/gV/WMnFQBjU+ew2/04rQRxZZV2qNZBE8MX5XwU='
WHERE
key_id = '453637cf95d07d045c40f5dbbbf23c1943cf898b723924d0599416af456d0cd1'
AND (
token = 'mdJB/gV/WMnFQBjU+ew2/04rQRxZZV2qNZBE8MX5XwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)