UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RhsrD/oKv+LZQDAy0AEDkNoDL0z2g7dh5Dz9W70LUWU='
WHERE
key_id = '835cdc76b683e5d2476ec04692cfd33f425920071ee18bb042664bab52f4a3cd'
AND (
token = 'RhsrD/oKv+LZQDAy0AEDkNoDL0z2g7dh5Dz9W70LUWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)