UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1tGC2Hb3vSAXULPULpXsM1PjdLMH17kfNAXoD/S/SUg='
WHERE
key_id = '347721c08c453110b356f9a843224ad02261f2f80c638e4786c11061d0369539'
AND (
token = '1tGC2Hb3vSAXULPULpXsM1PjdLMH17kfNAXoD/S/SUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)