UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EDjxgsxONBgq6CGnOr20Fd7rRohfS265SKGDkbUXDHc='
WHERE
key_id = '368e7ed8201255d6e940f245da5c57538fa2392ff1e2973c9d4ab74936bbb81f'
AND (
token = 'EDjxgsxONBgq6CGnOr20Fd7rRohfS265SKGDkbUXDHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)