UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UGe71qXrd4pxjPgJUDEEIE8090Hhr9WmRO02QyAk9hA='
WHERE
key_id = 'a76b37192895c572a89bffabfb12832b877ff0c83d1169b472432685546ba91d'
AND (
token = 'UGe71qXrd4pxjPgJUDEEIE8090Hhr9WmRO02QyAk9hA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)