UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4h7sf0SA9y/9fVVs/efz9nou2xMGEyDBLOQuwounfQs='
WHERE
key_id = '1fb77b1180eba2a0552fe1826b0f109e63af33931945f9ea1e53b46773e81b62'
AND (
token = '4h7sf0SA9y/9fVVs/efz9nou2xMGEyDBLOQuwounfQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)