UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UOlIZJl6UXfKScaPaVT28Hud5y1stQO/XarvlgqMFC4='
WHERE
key_id = 'd94580a21fcff6a3422a35b64e82f7158dd962044f8008b2a06f6cd3b64f1f25'
AND (
token = 'UOlIZJl6UXfKScaPaVT28Hud5y1stQO/XarvlgqMFC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)