UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YTTtbDLO1sKrSA2C4gOCyj6RWKKq6qDO+yRc3g9ZDF4='
WHERE
key_id = 'dbc2ec0c60506e94e82df69beb791ff41580c9b24de4f85120b2845423613093'
AND (
token = 'YTTtbDLO1sKrSA2C4gOCyj6RWKKq6qDO+yRc3g9ZDF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)